using System;
using UnityEngine;

public class FirestarterAnimator : FormAnimator {

    void OnDisable() {
        AnimatorComponent.ResetTrigger("Attack");
    }

    protected override void ConnectedFormController(FormController controller) {
        base.ConnectedFormController(controller);

        PlayerInput input = controller.GetComponent<PlayerInput>();
        input.OnAttack.AddListener(Attack);
    }

    void Attack() {
        if(gameObject.activeInHierarchy && !AnimatorComponent.GetCurrentAnimatorStateInfo(1).IsName("Attack"))
            AnimatorComponent.SetTrigger("Attack");
    }
}